package com.edfu.core.institutemgt.persistence.entity;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.edfu.core.identitymgt.persistence.entity.RoleEntity;
import com.edfu.core.identitymgt.persistence.entity.UserEntity;

@Entity
@Table(name="institutemember")
public class InstituteMemberEntity implements IInstituteMgtEntity {
	private long id;
	private UserEntity member;
	private RoleEntity role;
	private InstituteEntity institute;
	private Date addedOn;
	
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	public long getId() {
		return id;
	}
	public void setId(long id) {
		this.id = id;
	}
	
	
	@ManyToOne
	@JoinColumn(name = "user_id", nullable = false)
	public UserEntity getMember() {
		return member;
	}
	public void setMember(UserEntity member) {
		this.member = member;
	}
	
	@ManyToOne
	@JoinColumn(name = "role_id", nullable = false)
	public RoleEntity getRole() {
		return role;
	}
	public void setRole(RoleEntity role) {
		this.role = role;
	}
	@ManyToOne
	@JoinColumn(name = "institute_id", nullable = false)
	public InstituteEntity getInstitute() {
		return institute;
	}
	public void setInstitute(InstituteEntity institute) {
		this.institute = institute;
	}
	public Date getAddedOn() {
		return addedOn;
	}
	public void setAddedOn(Date addedOn) {
		this.addedOn = addedOn;
	}
	
	
}
